package com.controllers
{
	import com.views.View;
	
	import flash.events.IEventDispatcher;

	public class Controller extends Object
	{
		private var _target:IEventDispatcher;
		private var _mouse:MouseController;
		private var _keyboard:KeyboardController;
		private var _keyTarget:IEventDispatcher;
		protected var _view:View;
		public function Controller()
		{
			super();
		}
		public function initController(target:View):void{
			_keyTarget = target.stage;
			_view = target;
		}
		
		public function createController():void{
		}
		
		public function get mouse():MouseController{
			_mouse = new MouseController(_target);
			return _mouse;
		}
		public function get keyBoard():KeyboardController{
			if(_keyboard == null){
				_keyboard = new KeyboardController(_keyTarget);
			}
			return _keyboard;
		}
		
		
		public function set mouseTarget($target:IEventDispatcher):void{
			_target = $target;
		}
	}
}